UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UbM9ChRrmrrJb5jnFG8SknF7e7qsYYRnIrlwCpVQOso='
WHERE
key_id = 'db73a35f00b09d88c1b12d7a52847e267470f2550119a71f9812a7937bf97763'
AND (
token = 'UbM9ChRrmrrJb5jnFG8SknF7e7qsYYRnIrlwCpVQOso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)