UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2et4TNKQFvMZDiisXtPnh1npuMm1ZDeJUBUrTfedzhU='
WHERE
key_id = '39eef9e3ee4ba4fef4c3472e48fbaa0029bda9da54725739592662a45eedeb26'
AND (
token = '2et4TNKQFvMZDiisXtPnh1npuMm1ZDeJUBUrTfedzhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)