UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G9g2wCTLuflCQllwpAXegdXjnu0Zv8t1fdltQbA0Cns='
WHERE
key_id = 'e446e4a9e5ec556f9cc70e4533b44568221eb0c4af99a0719628378f457a48f8'
AND (
token = 'G9g2wCTLuflCQllwpAXegdXjnu0Zv8t1fdltQbA0Cns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)