UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '569btGe/3b1qn0TZL66zlkc1y/4Q4zN3KMy02hk9kMo='
WHERE
key_id = 'b02e2b26dd26ee2086036ce9cfd5fb42ef0f56850b31318d19a625e476e748bd'
AND (
token = '569btGe/3b1qn0TZL66zlkc1y/4Q4zN3KMy02hk9kMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)