UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WgipUgixBgWo4n5ZJRZs71JBqu+I7YeDTPg2QbmGUUY='
WHERE
key_id = 'd3ea3264401f6cd899129bbbc8d5027d8a0be0cb5ae598619f1daf159fb4b634'
AND (
token = 'WgipUgixBgWo4n5ZJRZs71JBqu+I7YeDTPg2QbmGUUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)