UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sPyZ0XtPBaSnhJjj0WioGabaXk+ARzwXZQMzp1Dvyxs=' 
WHERE 
  key_id = '3cb462647f0eff9b20644e351938df94d1ef2cbda0c3b8c76f7ade714d50cb8b' 
  AND (
    token = 'sPyZ0XtPBaSnhJjj0WioGabaXk+ARzwXZQMzp1Dvyxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039