UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQLgK2E7O5t1ADPSR5E3PovD3eUFBkwwqrK7c5kIKCo='
WHERE
key_id = '7eff9c53f21d487fa3a898b16034ebebfe8bece742cddcef09a7feaa6eb1fedb'
AND (
token = 'kQLgK2E7O5t1ADPSR5E3PovD3eUFBkwwqrK7c5kIKCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)