UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zO6kVOeBO8MQGLGkLtcct1C+2vQjBA6J7m7GAG5Vevs='
WHERE
key_id = '02fc3bb9baaf5ad53387a6246c28c73887527a7019cde505ae26c67814998dab'
AND (
token = 'zO6kVOeBO8MQGLGkLtcct1C+2vQjBA6J7m7GAG5Vevs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)