UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pVZ5uNVeat0gTQMa4qmpUch9HD2CZ66CGXapeDAEp3g=' 
WHERE 
  key_id = 'c7d69189e243aa4e5725d81aa07e6d1e012dbcf2bbe7f482ce5072280ca6c502' 
  AND (
    token = 'pVZ5uNVeat0gTQMa4qmpUch9HD2CZ66CGXapeDAEp3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027