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