UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sgpge/nd7xEbCwMJi+gzN7tCKD4hkRaQn2wp/U9IQ8M='
WHERE
key_id = '568b0d5ee45e3bdb8f450a2f8e3854064e11977906212d027d03a9370d07e4da'
AND (
token = 'sgpge/nd7xEbCwMJi+gzN7tCKD4hkRaQn2wp/U9IQ8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)