UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TREg6qRygzx3vI6V167nDPgN5A/xQ1KBCPZYQn0tDFQ='
WHERE
key_id = '3db68499a8c6de28949def4bb9909f1633b5c6c83bc436cafaeba40a569f68b8'
AND (
token = 'TREg6qRygzx3vI6V167nDPgN5A/xQ1KBCPZYQn0tDFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)