UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmEnUSU/JaIIqwi4byEu/Lesfi3FvXQm/W6z3hxxsAw='
WHERE
key_id = '5f6c4d1651c5443fc9f20fa4294e5f6f5b68014f6a4fbb1b2d17f1a9a476c596'
AND (
token = 'pmEnUSU/JaIIqwi4byEu/Lesfi3FvXQm/W6z3hxxsAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)