UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i+FRS3F6vOFxa6NuAYXhM1b9IUO+ZPMEXRyPrlMU24Q=' 
WHERE 
  key_id = '36a0034a2a74f9cf4ac049c4ef8b70c6af5052d5313dfdc62c034ae3917b6039' 
  AND (
    token = 'i+FRS3F6vOFxa6NuAYXhM1b9IUO+ZPMEXRyPrlMU24Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058