UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4lisrRskFRrqX2JnwPRDjXOVrOj2V4LA1nu69BBBnRw='
WHERE
key_id = '070ecea4c03b84a4c3b07807b89ea6fb91f66e2db599b885fdaa1086226552cb'
AND (
token = '4lisrRskFRrqX2JnwPRDjXOVrOj2V4LA1nu69BBBnRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)