UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HG3z0lZ5WoHydfcoyJUs2OMnobHB9JK1yDDgKuEG4p4=' 
WHERE 
  key_id = '7920eb621e96ebe65e1c1a794715b2aa9b34617a22d6abb67e2b661160f10f86' 
  AND (
    token = 'HG3z0lZ5WoHydfcoyJUs2OMnobHB9JK1yDDgKuEG4p4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028