UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8dfeSAED2FkwgXS0sT8PIfwHMQ7M0MdAiE5SeeeO8RA='
WHERE
key_id = '88c6708452a24d763c929d034fa99d4cb82f7bc906e5a0b1d19fee58bbb8a7bc'
AND (
token = '8dfeSAED2FkwgXS0sT8PIfwHMQ7M0MdAiE5SeeeO8RA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)