UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YxBRDB5M9iqsGHbGXA0LMnLPWrijxT3rOYGk1fiexwg='
WHERE
key_id = '3b85dc578db5d94abdd7031fe06f3cfff62abe10cec78680af75f00fb1bf32da'
AND (
token = 'YxBRDB5M9iqsGHbGXA0LMnLPWrijxT3rOYGk1fiexwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)