UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7x8PD/0D1l9JDdT3oJrSHNpeJUEjrPi1eWvkAazp1b8='
WHERE
key_id = 'ef77ac74b705e18f7b5370acbe90bebfa16c357c3ccb384ec688c50ffec6887f'
AND (
token = '7x8PD/0D1l9JDdT3oJrSHNpeJUEjrPi1eWvkAazp1b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)