UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm7ig5HOgULt3RH6QaVrDRH+gC8D9PFOVuqyadnIN74o='
WHERE
key_id = '358a1fc51fa37e2fedaee6e6c41f1e66ff7b4b8f18341ba668534ae73096eef1'
AND (
token = 'm7ig5HOgULt3RH6QaVrDRH+gC8D9PFOVuqyadnIN74o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)