UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qqv+zy4n/h3Hx51cpcyTXGbbJX+WCa8VWvoP5viQcgM='
WHERE
key_id = 'e4e9961030ecd5dfdd3629f6e0ea7f52eff38fb894649ed405095af1d1b70958'
AND (
token = 'Qqv+zy4n/h3Hx51cpcyTXGbbJX+WCa8VWvoP5viQcgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)