UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rJ+ryqp5HXVf65jX84u6L749AHiDaSFIvLYTVByVV50='
WHERE
key_id = '5b29fa6c87408802c6b0a6b6de8b04e5ed56debd1e7bd220663318ab70c34f5b'
AND (
token = 'rJ+ryqp5HXVf65jX84u6L749AHiDaSFIvLYTVByVV50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)