UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S1gUR92UUFWyU54We0b4xxCR/+6T5HOpBA+gpC6r6wU='
WHERE
key_id = '5eb7857a3e704328cfe08fe877577ea7738e74c095736a6ce78b216f38411a2b'
AND (
token = 'S1gUR92UUFWyU54We0b4xxCR/+6T5HOpBA+gpC6r6wU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)