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