UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCCvKFiqx/Fapq9Um8D7HR942UQoQAsi/EVXoNFgLow=' 
WHERE 
  key_id = '18d75dd28a7410055d4681bbc7574ff9a3f2d76ff4e772699271e647957723cd' 
  AND (
    token = 'VCCvKFiqx/Fapq9Um8D7HR942UQoQAsi/EVXoNFgLow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046