UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSER6dATHkEykbMFg3d0tt/36rJ+zg9ekMsj3ZB79HE='
WHERE
key_id = 'd6de2d04b2c0645bd279615e9b2ca07382d039b76df5855a0612d6fab552badb'
AND (
token = 'OSER6dATHkEykbMFg3d0tt/36rJ+zg9ekMsj3ZB79HE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)