UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S07tPUd5gSdrb9ouhJVGPUB9pWNXJ6WAdAToMLvlVyg='
WHERE
key_id = '6f3f8bd3500efe6b859ccda19d17494f965031fad74908bdb18233e5e512aa6b'
AND (
token = 'S07tPUd5gSdrb9ouhJVGPUB9pWNXJ6WAdAToMLvlVyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)