UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bWzU+uV6PDGVUKytldKdcWhhC0KPUE1rj7KsrFzC8RM='
WHERE
key_id = '35f56883793166bd282a7e617faef3d1ba55313263a8d3a49ba7566069cd43be'
AND (
token = 'bWzU+uV6PDGVUKytldKdcWhhC0KPUE1rj7KsrFzC8RM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)