UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HHG/ARFKetX5oz2olI9YC3Sg4wQjLMRTcVWvGpj/T2c='
WHERE
key_id = '4ee439e4d523b00236bf1538823d05e5ddee16938d6e6d94d586c561286b1616'
AND (
token = 'HHG/ARFKetX5oz2olI9YC3Sg4wQjLMRTcVWvGpj/T2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)