UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ix4/85c4FO0RI4xADxWxEiKiWGMv+idV3utNB1CWy4Q='
WHERE
key_id = '6c36573d94fbb26cdde70f4ee8f9d794409eb671d6beeeaabea8e16da2d50cb2'
AND (
token = 'Ix4/85c4FO0RI4xADxWxEiKiWGMv+idV3utNB1CWy4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)