UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rvebsdiI8dv7NWEt7VtIn4XSvoQxyBftRdykGM9K5gs=' 
WHERE 
  key_id = '72fdf30acf4124ef6a2e7ead4ce4a5227b40f2bce47ce9152de3f437815d45d2' 
  AND (
    token = 'rvebsdiI8dv7NWEt7VtIn4XSvoQxyBftRdykGM9K5gs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018