UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RSmuRHLB6KEtkDa4LiUq3dtfD7PmvrJM2lslE9+Rixs='
WHERE
key_id = '906f68ee21937e4b8b04935911306739cd9aa35782f9b8477733556ff4fda150'
AND (
token = 'RSmuRHLB6KEtkDa4LiUq3dtfD7PmvrJM2lslE9+Rixs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)