UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/6OoLtsePZF1X/ZzhBut8id9r9CLUQit7NhmBCIVgY=' 
WHERE 
  key_id = 'b30f754f23b396eae41b38f1e7c92de9bb03ed25ba4406b8b0c41a75a780e9f2' 
  AND (
    token = 'j/6OoLtsePZF1X/ZzhBut8id9r9CLUQit7NhmBCIVgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019