UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Erm1mbWYv9haVvUSpSGOIvbws++cqzMPkukfHxlx6QA='
WHERE
key_id = '1aa7b82ab674539585d5ba1acdbe2a08c28f0ed9199e554e5cee23d2d17cb266'
AND (
token = 'Erm1mbWYv9haVvUSpSGOIvbws++cqzMPkukfHxlx6QA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)