UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FC4+uK7mfR3+LZ+lHvPWW5ftPlgv/xwcIAM5brMrCzs=' 
WHERE 
  key_id = '6bc294f82bceb6aa3c0413d2f380b31e6f4ae02296dfb1a8cf59784fc9188049' 
  AND (
    token = 'FC4+uK7mfR3+LZ+lHvPWW5ftPlgv/xwcIAM5brMrCzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035